package com.zzh.rabbit;

import android.os.Bundle;

import com.zzh.lib.core.HLibrary;
import com.zzh.lib.core.utils.HFileUtils;
import com.zzh.mvvm.base.BaseRabbitFragment;
import com.zzh.rabbit.databinding.FragInBinding;

/**
 * Created by ZZH on 2022/6/2.
 *
 * @Date: 2022/6/2
 * @Email: zzh_hz@126.com
 * @QQ: 1299234582
 * @Author: zzh
 * @Description:
 */
public class FragSub extends BaseRabbitFragment<FragViewModel, FragInBinding> {
    @Override
    protected int initVariableId() {
        return BR.viewModel;
    }

    @Override
    protected void initViewAndData(Bundle savedInstanceState) {
        super.initViewAndData(savedInstanceState);
        StringBuilder sb = new StringBuilder();
        sb.append("文件路径:\n\n无需申请存储权限\n\n");
        sb.append("App内部私有路径：\n\n");

        sb.append("App pkg path: HFileUtils.getPrivateAppFilePath()").append("\n").append(HFileUtils.getPrivateAppFilePath()).append("\n\n\n");
        sb.append("cache: HFileUtils.getPrivateCacheFilePath()").append("\n").append(HFileUtils.getPrivateCacheFilePath()).append("\n\n\n");
        sb.append("files: HFileUtils.getPrivateFilesFilePath()").append("\n").append(HFileUtils.getPrivateFilesFilePath()).append("\n\n\n");
        sb.append("files child: HFileUtils.getPrivateFilesFilePath()").append("\n").append(HFileUtils.getPrivateFilesFile("sub").getAbsolutePath()).append("\n\n\n");
        sb.append("databases: HFileUtils.getPrivateDatabaseFilePath()").append("\n").append(HFileUtils.getPrivateDatabaseFilePath()).append(
                "\n\n\n");
        sb.append("shared_prefs: HFileUtils.getPrivateSharedPrefsFilePath()").append("\n").append(HFileUtils.getPrivateSharedPrefsFilePath()).append(
                "\n\n\n");

        sb.append("App内部存储私有路径：\n\n");
        sb.append("App pkg path: HFileUtils.getPrivateExternalAppFilePath()").append("\n").append(HFileUtils.getPrivateExternalAppFilePath()).append("\n\n\n");
        sb.append("ext cache: HFileUtils.getPrivateExternalCacheFilePath()").append("\n").append(HFileUtils.getPrivateExternalCacheFilePath()).append("\n\n\n");
        sb.append("ext files: HFileUtils.getPrivateExternalFilesFilePath()").append("\n").append(HFileUtils.getPrivateExternalFilesFilePath()).append("\n\n\n");
        sb.append("ext files child: HFileUtils.getPrivateExternalFilesFile()").append("\n").append(HFileUtils.getPrivateExternalFilesFile("sub").getAbsolutePath()).append("\n\n\n");
        sb.append("ext shared_prefs: HFileUtils.getPrivateExternalSharedPrefsFilePath()").append("\n").append(HFileUtils.getPrivateExternalSharedPrefsFilePath()).append("\n\n\n");
        bind.fileStorage.setText(sb);

    }
}
